package lk.icta.core.dao;


import lk.icta.common.entity.District;
import lk.icta.common.entity.RailwayTrack;
import lk.icta.core.entity.AlienationRailway;
import lk.icta.user.entity.User;

import java.util.Date;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;

/**
 * @author Kusal Samarakoon
 */
public interface AlienationRailwayDAO {

    /**
     * Add an Alienation
     *
     * @param alienation The Alienation to be added
     * @param user       The user requesting to add the alienation
     */
    public void addAlienation(AlienationRailway alienation, User user);

    /**
     * Update an Alienation
     *
     * @param alienation The alienation to be updated
     * @param user       The user requesting to update the alienation
     */
    public void updateAlienation(AlienationRailway alienation, User user);

    /**
     * Find alienation by Alienation Id
     *
     * @param id   The Alienation Id
     * @param user The user requesting to find the alienation
     * @return An alienation corresponding to the given id
     */
    public AlienationRailway getAlienationById(Long id, User user);


    public AlienationRailway getActiveAlienationByLandId(long landId, User user);

    public List<AlienationRailway> getAlienationRailwayByStateSet(User user, EnumSet<AlienationRailway.State> stateSet);

    public List<AlienationRailway> getAlienationRailwayByStateSet(User user, EnumSet<AlienationRailway.State> stateSet, int pageNo, int showMigs, int noOfRows);

    public int getAllAlienationRailwaysCountByState(User user,EnumSet<AlienationRailway.State> stateSet);

    public List<AlienationRailway> getAlienationRailwayByLeaseId(User user, String leaseId);

    public List<AlienationRailway> getAlienationRailwayByLeaseIdAndStateSet(User user, String leaseId,EnumSet<AlienationRailway.State> stateSet);

    List<AlienationRailway> getAlienationRailwayByTrackAndDistrictSet(District d, RailwayTrack railwayTrack);

    List<Object[]> getAlienationStatisticsData(int branchId, int trackId, int districtId, Date startDate, Date endDate, double fromValue, double toValue);

    List<AlienationRailway> getAlienationDetailsList(int branchId, int railwayTrackId, int districtId, Date startDate, Date endDate, int startingVal, int endingVal);

    List<AlienationRailway> getAlienationByStartedDay(int day, int month);

    List<AlienationRailway> getAlienationByValuationStartDay(int day, int month);

    List<AlienationRailway> getAlienationStatisticsByFilters(int branchId, int trackId, int districtId, long minAmnt, long maxAmnt);

    List<AlienationRailway> getAlienationsByIdRnage(long start, long end);

    List<AlienationRailway> getAlienationRailwayByFilters(int branchId, int railwayTrackId, int districtId);

    List<AlienationRailway> getAlienationLikeReferenceNo(String referenceNo);

}
